package com.ruoyi.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.business.PublishGoods;
import com.ruoyi.business.PublishGoodsBO;
import com.ruoyi.business.vo.PublishGoodsListVO;
import com.ruoyi.business.vo.PublishGoodsSttaticticsVO;
import com.ruoyi.business.vo.PublishGoodsVO;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface PublishGoodsMapper extends BaseMapper<PublishGoods> {
    int deleteByPrimaryKey(Integer id);


    int insertSelective(PublishGoods record);

    PublishGoods selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(PublishGoods record);

    int updateByPrimaryKey(PublishGoods record);

    IPage<PublishGoodsListVO> queryPage(@Param("page") Page page, @Param("publishGoodsBO") PublishGoodsBO publishGoodsBO);

    /**
     * @author jiangguanjun
     * @date 2023/2/10 12:36
     * @param cId 品类id adminId 管理员id createStartDate 创建开始时间 createEndDate：创建结束时间 excludeAdminBuy：是否排除管理员购买的
     * @return
     * @desc
     */
    List<PublishGoodsSttaticticsVO> staticticsList(@Param("cId") Integer cId,
                                                   @Param("adminId") Integer adminId,
                                                   @Param("createStartDate") Date createStartDate,
                                                   @Param("createEndDate") Date createEndDate,
                                                   @Param("excludeAdminBuy") boolean excludeAdminBuy);

    PublishGoodsVO selectVOById(Integer id);
}